//防抖
function debounce(func, wait) {
    let timer = null;
    return function() {
        if(timer) {
            clearTimeout(timer);
        }
            timer = setTimeout(()=>{
                func();
            },wait)
        
    }
}
let timer = null
let input = document.addEventListener('input',debounce(()=>{
    console.log('防抖成功');
},1000))